// https://www.hackerrank.com/challenges/cavity-map#include <stdio.h>#include <math.h>#include <stdlib.h>int grid[101][101];int main(){    int n,i,j;    char arr[101];    scanf("%d",&n);    for (i=0; i<n; ++i) {        scanf ("%s", arr);        for (j=0; j<n; ++j)            grid[i][j] = arr[j]-'0';    }    for (i=0; i<n; i++) {       	for (j=0; j<n; j++) {            if (i!=0 && i!=n-1 && j!=0 && j!=n-1 && grid[i][j]>grid[i-1][j] && grid[i][j]>grid[i][j-1] && grid[i][j]>grid[i][j+1] && grid[i][j]>grid[i+1][j]) {                printf("X");            }            else                printf("%d",grid[i][j]);        }        printf("\n");    }        return 0;}